<style>
    .panel-header, .panel-body {
        border-width: 0px;
    }

    .datagrid, .combo-p {
        border: solid 1px #D4D4D4;
    }

    .panel-title {
        cursor: pointer
    }

    .inlineblock {
        margin-top: 10px;
    }

    .inlineblock div {
        display: inline-block;
    }

    .inlineblock div label {
        display: inline-block;
        top: 5px;
    }

    .newform {
        width: 70%;
    }

    .editform {
        width: 70%;
    }

    .searchClass {
        margin-left: 5%;
        margin-top: 1%;
    }

    .searchClass label {        width: 9%;
        font-weight: bold;
        text-align: center;
    }

    #Search {
        float: right;
        margin-right: 4%;
        width: 14%;
    }
    .ssss{
        color: #FFF;padding:5px 15px;background-color:#3F51B5;
        margin-right:20px;
    }
    .ssss:hover,.ssss:link,.ssss:visited,.ssss:active{
        color: #FFF;
        text-decoration: none;
    }
</style>
<div class="row">
    <div id="breadcrumb" class="col-xs-12" style="margin-bottom: 10px">
        <a href="#" class="show-sidebar"> <i class="fa fa-bars"></i>
        </a>
        <ol class="breadcrumb pull-left">
            <li><a href="#">账户管理</a></li>
            <li><a href="#">账户管理</a></li>
        </ol>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <div class="box-name">
                    <i class="fa fa-clipboard"></i> <span>账户管理</span>
                </div>
                <div class="box-icons">
                    <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                    </a> <a class="expand-link"> <i class="fa fa-expand"></i>
                </a> <a class="close-link"> <i class="fa fa-times"></i>
                </a>
                </div>
                <div class="no-move"></div>
            </div>
            <div class="box-content table-responsive" style="padding-top: 15px">

                <div class="panel" style="background-color: #DFE1EB; height: auto;">
                    <div class="panel-heading" role="tab" style="width: 10%;float: left;">
                        <h4 class="panel-title">&nbsp;</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 10%;float: left;">
                        <h4 class="panel-title">名称</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">可用</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">提现锁定金额</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">总计</h4>
                    </div>
                    <div class="panel-heading" role="tab" style="width: 20%;float: left;">
                        <h4 class="panel-title">&nbsp;</h4>
                    </div>
                </div>
                
                <div style="border: 1px solid #CCC; height: 50px;background-color:#E8EBEF;line-height: 50px;">
                    <div style="width: 10%;float: left;padding-left: 15px">
                        <p>¥</p>
                    </div>
                    <div style="width: 10%;float: left;padding-left: 15px">
                        <p>人民币</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>¥ {if $admin['user_rmb']}{$admin['user_rmb']}{else}0{/if}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>¥ {$ready_rmb}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>¥ {$all_rmb}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>
                            <a class="ssss" href="JavaScript:;" onclick="alert('暂不支持在线充值，请联系管理员充值');">充值</a>
                            <a class="ssss rmborytbout" href="JavaScript:;" name="1">提现</a>
                        </p>
                    </div>
                </div>
                <div style="height: 3px;width: 100%;"></div>
                <style>
                    .wsdfgh div{margin-top: -7px}
                </style>
                <div class="wsdfgh" style="border: 1px solid #CCC; height: 50px;background-color:#E8EBEF;line-height: 50px;">
                    <div style="width: 10%;float: left;padding-left: 15px;">
                        <p><img src="__WK__/style/images/ytb.png" height="20"></p>
                    </div>
                    <div style="width: 10%;float: left;padding-left: 15px">
                        <p>以太币</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>{if $admin['user_ytb']}{$admin['user_ytb']}{else}0{/if}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>{$ready_ytb}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>{$all_ytb}</p>
                    </div>
                    <div style="width: 20%;float: left;padding-left: 15px">
                        <p>
                            <a class="ssss" href="JavaScript:;" onclick="alert('暂不支持在线充值，请联系管理员充值');">充值</a>
                            <a class="ssss rmborytbout" href="JavaScript:;" name="2">提现</a>
                        </p>
                    </div>
                </div>

                <!--主信息面板 S-->
                <div class="panel panel-default" style="border: 1px solid #CCC;">
                    <div class="panel-heading" role="tab" id="headingTwo">
                        <h4 class="panel-title" data-toggle="collapse" data-target="#collapseForCourseTable">
                            提现记录<span class="fa fa-chevron-down" style="float: right"></span>
                        </h4>
                    </div>
                    <div id="collapseForCourseTable" class="panel-collapse collapse in" role="tabpanel"
                         aria-labelledby="headingTwo">
                        <table id="datatable_payinfo" data-size="15" style="width: 100%">
                        </table>
                    </div>
                </div>
                <!--主信息面板 E-->
            </div>
        </div>
    </div>
</div>
<input type="hidden" id="zige" value="{$admin['user_rmb']}" />
<script src="static/js/ajax/pay.js"></script>
<script>
    $('.rmborytbout').click(function () {
        var zige = $('#zige').val();
        if(zige <= 0){
			alert('请先充值！');
			return;
		}else{
            var type = $(this).attr('name');
            var content = "";
            $.ajax({
                url: 'admin/Pay/rmb_out',
                type: 'POST',
                data:'type='+type,
                dataType: 'HTML',//返回的数据类型
                success: function (updatemodalhtml) {
                    content = updatemodalhtml;
                    //弹出添加框
                    $.TeachDialog({
                        title: '提现',
                        content: content,
                        showCloseButton: true,
                        showCloseButtonName: '关闭',
                        otherButtons: ['确定'],
                        otherButtonStyles: ['btn-primary'],
                        clickButton: function (sender, modal, index) {
                            var type = $('#type').val();
                            var rmb = $('#rmbrmb').val();
                            var ytb = $('#ytbytb').val();
                            var money = $('#money').val().trim();
                            var rule1 = /^[1-9]+\.?[0-9]*$/;
                            var rule2 = /^[0]{1}\.?[0-9]*$/;
                            if(!(rule1.test(money)) && !(rule2.test(money))){
                                $.TeachDialog({
                                    content: '请正确输入提现金额'
                                });
                                return;
                            }
                            if(rmb-0 <= 0){
                                $.TeachDialog({
                                    content: '您不允许提现，请先充值'
                                });
                                return;
                            }
                            if(money-0 <= 0){
                                $.TeachDialog({
                                    content: '提现金额不能小于0'
                                });
                                return;
                            }
                            if(type==1 && (money-0) > (rmb-0)){
                                $.TeachDialog({
                                    content: '您没有这么多余额，请检查后输入1'
                                });
                                return;
                            }
                            if(type==2 && (money-0)>(ytb-0)){
                                $.TeachDialog({
                                    content: '您没有这么多余额，请检查后输入'
                                });
                                return;
                            }
                            $.ajax({
                                url: 'admin/Pay/ask_out',
                                data: $("#addaskForm").serialize(),
                                type: 'POST',
                                dataType: 'JSON',
                                success: function (returnData) {
                                    if (returnData.status == 0) {
                                        $.TeachDialog({
                                            content: returnData.msg
                                        });
                                    } else if(returnData.status == 10){
                                        $('#deal').text(returnData.msg);
                                        $('#deal').css('color','red');
                                        return;
                                    }else {
                                        location.reload();
                                        return;
                                    }
                                },
                                error: function () {
                                    $.TeachDialog({
                                        content: '系统异常，请联系管理员',
                                    });
                                },

                            });

                        },
                    });
                },
                error: function () {
                    $.TeachDialog({
                        content: '系统异常，请联系管理员',
                    });
                    return;
                }
            });
        }
    });


</script>